{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os \n",
    "import datasets\n",
    "import pandas as pd\n",
    "from glob import glob\n",
    "from dotenv import load_dotenv\n",
    "\n",
    "load_dotenv(\"../.env\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "files = glob('../data/datasets/*.*')\n",
    "files = sorted(files)\n",
    "files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for file in files:\n",
    "    print(file)\n",
    "    df = pd.read_parquet(file)\n",
    "    if \"index\" in df.columns:\n",
    "        del df[\"index\"]\n",
    "    if \"id\" in df.columns:\n",
    "        del df[\"id\"]\n",
    "    dataset = datasets.Dataset.from_pandas(df)\n",
    "    filename = file.split('/')[-1].split('.')[0]\n",
    "    print(filename)\n",
    "    dataset.push_to_hub(\"galileo-ai/agent-leaderboard\", \n",
    "                    config_name=filename,\n",
    "                    split=\"test\",\n",
    "                    token=os.getenv(\"HF_TOKEN\"))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "langgraph",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
